package cj.web.sc.dao;

import java.util.List;
import java.util.Map;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;

@DAO
public interface AppTokenDAO {

	//----------------------------------Token操作
	@SQL("INSERT INTO AppToken (phone,token,createAt,state) VALUES (:1,:2,now(),1) ")
	void createToken(String phone,String token);
	
	@SQL("SELECT count(1) FROM AppToken WHERE phone=:1 AND token=:2 And state=1")
	int queryToken(String phone,String token);
	
	@SQL("UPDATE AppToken SET state=0 WHERE phone=:1 ")
	void updateToken(String phone);
	
	@SQL("SELECT * FROM ConfigInfo WHERE code=:1 and deleteFlag=1 ")
	List<Map> queryConfigInfo(String code);
}
